import { PartialType } from '@nestjs/swagger'
import { CreateUserDto } from './create-user.dto'
import { IsOptional, IsString, MinLength } from 'class-validator'
import { ApiProperty } from '@nestjs/swagger'

/**
 * 更新用户DTO
 * 继承创建DTO，但所有字段都是可选的
 */
export class UpdateUserDto extends PartialType(CreateUserDto) {
  @ApiProperty({ description: '密码', example: '123456', required: false })
  @IsOptional()
  @IsString()
  @MinLength(6)
  password?: string
}
